package org.fernando.serializer;

import com.google.inject.Inject;
import com.google.inject.Provider;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.diagnostic.ISemanticSequencerDiagnosticProvider;
import org.eclipse.xtext.serializer.diagnostic.ISerializationDiagnostic.Acceptor;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.GenericSequencer;
import org.eclipse.xtext.serializer.sequencer.ISemanticNodeProvider.INodesForEObjectProvider;
import org.eclipse.xtext.serializer.sequencer.ISemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
import org.fernando.planificacionDeCursada.Asignacion;
import org.fernando.planificacionDeCursada.Aula;
import org.fernando.planificacionDeCursada.DIA;
import org.fernando.planificacionDeCursada.DiaDeLaSemana;
import org.fernando.planificacionDeCursada.DisponibilidadProf;
import org.fernando.planificacionDeCursada.Exclusiva;
import org.fernando.planificacionDeCursada.Materia;
import org.fernando.planificacionDeCursada.MateriaAsig;
import org.fernando.planificacionDeCursada.Planificacion;
import org.fernando.planificacionDeCursada.PlanificacionDeCursadaPackage;
import org.fernando.planificacionDeCursada.Profesor;
import org.fernando.planificacionDeCursada.Recurso;
import org.fernando.planificacionDeCursada.Semi;
import org.fernando.planificacionDeCursada.Simple;
import org.fernando.services.PlanificacionDeCursadaGrammarAccess;

@SuppressWarnings("all")
public class PlanificacionDeCursadaSemanticSequencer extends AbstractDelegatingSemanticSequencer {

	@Inject
	private PlanificacionDeCursadaGrammarAccess grammarAccess;
	
	public void createSequence(EObject context, EObject semanticObject) {
		if(semanticObject.eClass().getEPackage() == PlanificacionDeCursadaPackage.eINSTANCE) switch(semanticObject.eClass().getClassifierID()) {
			case PlanificacionDeCursadaPackage.ASIGNACION:
				if(context == grammarAccess.getAsignacionRule()) {
					sequence_Asignacion(context, (Asignacion) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.AULA:
				if(context == grammarAccess.getAulaRule()) {
					sequence_Aula(context, (Aula) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.DIA:
				if(context == grammarAccess.getDIARule()) {
					sequence_DIA(context, (DIA) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.DIA_DE_LA_SEMANA:
				if(context == grammarAccess.getDiaDeLaSemanaRule()) {
					sequence_DiaDeLaSemana(context, (DiaDeLaSemana) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.DISPONIBILIDAD_PROF:
				if(context == grammarAccess.getDisponibilidadProfRule()) {
					sequence_DisponibilidadProf(context, (DisponibilidadProf) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.EXCLUSIVA:
				if(context == grammarAccess.getDEDICACIONRule() ||
				   context == grammarAccess.getExclusivaRule()) {
					sequence_Exclusiva(context, (Exclusiva) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.MATERIA:
				if(context == grammarAccess.getMateriaRule()) {
					sequence_Materia(context, (Materia) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.MATERIA_ASIG:
				if(context == grammarAccess.getMateriaAsigRule()) {
					sequence_MateriaAsig(context, (MateriaAsig) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.PLANIFICACION:
				if(context == grammarAccess.getPlanificacionRule()) {
					sequence_Planificacion(context, (Planificacion) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.PROFESOR:
				if(context == grammarAccess.getProfesorRule()) {
					sequence_Profesor(context, (Profesor) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.RECURSO:
				if(context == grammarAccess.getRecursoRule()) {
					sequence_Recurso(context, (Recurso) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.SEMI:
				if(context == grammarAccess.getDEDICACIONRule() ||
				   context == grammarAccess.getSemiRule()) {
					sequence_Semi(context, (Semi) semanticObject); 
					return; 
				}
				else break;
			case PlanificacionDeCursadaPackage.SIMPLE:
				if(context == grammarAccess.getDEDICACIONRule() ||
				   context == grammarAccess.getSimpleRule()) {
					sequence_Simple(context, (Simple) semanticObject); 
					return; 
				}
				else break;
			}
		if (errorAcceptor != null) errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
	}
	
	/**
	 * Constraint:
	 *     (profesores+=Profesor* recursos+=Recurso* aulas+=Aula* materias+=Materia* planificacion=Planificacion)
	 */
	protected void sequence_Asignacion(EObject context, Asignacion semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID recursos+=[Recurso|ID]* cantAlumnos=INT)
	 */
	protected void sequence_Aula(EObject context, Aula semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (
	 *         ID='Lunes' | 
	 *         ID='Martes' | 
	 *         ID='Miercoles' | 
	 *         ID='Jueves' | 
	 *         ID='Viernes' | 
	 *         ID='Sabado'
	 *     )
	 */
	protected void sequence_DIA(EObject context, DIA semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (dia=DIA horaInicio=INT horaFin=INT materia=[Materia|ID] aula=[Aula|ID])
	 */
	protected void sequence_DiaDeLaSemana(EObject context, DiaDeLaSemana semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__DIA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__DIA));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__HORA_INICIO) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__HORA_INICIO));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__HORA_FIN) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__HORA_FIN));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__MATERIA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__MATERIA));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__AULA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DIA_DE_LA_SEMANA__AULA));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getDiaDeLaSemanaAccess().getDiaDIAParserRuleCall_1_0(), semanticObject.getDia());
		feeder.accept(grammarAccess.getDiaDeLaSemanaAccess().getHoraInicioINTTerminalRuleCall_3_0(), semanticObject.getHoraInicio());
		feeder.accept(grammarAccess.getDiaDeLaSemanaAccess().getHoraFinINTTerminalRuleCall_5_0(), semanticObject.getHoraFin());
		feeder.accept(grammarAccess.getDiaDeLaSemanaAccess().getMateriaMateriaIDTerminalRuleCall_7_0_1(), semanticObject.getMateria());
		feeder.accept(grammarAccess.getDiaDeLaSemanaAccess().getAulaAulaIDTerminalRuleCall_9_0_1(), semanticObject.getAula());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (dia=DIA horaInicial=INT horaFinal=INT)
	 */
	protected void sequence_DisponibilidadProf(EObject context, DisponibilidadProf semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__DIA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__DIA));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__HORA_INICIAL) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__HORA_INICIAL));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__HORA_FINAL) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DISPONIBILIDAD_PROF__HORA_FINAL));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getDisponibilidadProfAccess().getDiaDIAParserRuleCall_1_0(), semanticObject.getDia());
		feeder.accept(grammarAccess.getDisponibilidadProfAccess().getHoraInicialINTTerminalRuleCall_3_0(), semanticObject.getHoraInicial());
		feeder.accept(grammarAccess.getDisponibilidadProfAccess().getHoraFinalINTTerminalRuleCall_5_0(), semanticObject.getHoraFinal());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     ID='Exclusiva'
	 */
	protected void sequence_Exclusiva(EObject context, Exclusiva semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getExclusivaAccess().getIDExclusivaKeyword_0(), semanticObject.getID());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (materia=[Materia|ID] inscriptos=INT)
	 */
	protected void sequence_MateriaAsig(EObject context, MateriaAsig semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.MATERIA_ASIG__MATERIA) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.MATERIA_ASIG__MATERIA));
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.MATERIA_ASIG__INSCRIPTOS) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.MATERIA_ASIG__INSCRIPTOS));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getMateriaAsigAccess().getMateriaMateriaIDTerminalRuleCall_0_0_1(), semanticObject.getMateria());
		feeder.accept(grammarAccess.getMateriaAsigAccess().getInscriptosINTTerminalRuleCall_2_0(), semanticObject.getInscriptos());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID profesor=[Profesor|ID] cargaHoraria=INT cantDias=INT (recursos+=[Recurso|ID] recursos+=[Recurso|ID]*)?)
	 */
	protected void sequence_Materia(EObject context, Materia semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID materias+=MateriaAsig* diasDelaSemana+=DiaDeLaSemana*)
	 */
	protected void sequence_Planificacion(EObject context, Planificacion semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     (name=ID nombre=STRING tipo=DEDICACION disponibilidades+=DisponibilidadProf*)
	 */
	protected void sequence_Profesor(EObject context, Profesor semanticObject) {
		genericSequencer.createSequence(context, semanticObject);
	}
	
	
	/**
	 * Constraint:
	 *     name=ID
	 */
	protected void sequence_Recurso(EObject context, Recurso semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.RECURSO__NAME) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.RECURSO__NAME));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getRecursoAccess().getNameIDTerminalRuleCall_1_0(), semanticObject.getName());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     ID='Semi'
	 */
	protected void sequence_Semi(EObject context, Semi semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getSemiAccess().getIDSemiKeyword_0(), semanticObject.getID());
		feeder.finish();
	}
	
	
	/**
	 * Constraint:
	 *     ID='Simple'
	 */
	protected void sequence_Simple(EObject context, Simple semanticObject) {
		if(errorAcceptor != null) {
			if(transientValues.isValueTransient(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID) == ValueTransient.YES)
				errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, PlanificacionDeCursadaPackage.Literals.DEDICACION__ID));
		}
		INodesForEObjectProvider nodes = createNodeProvider(semanticObject);
		SequenceFeeder feeder = createSequencerFeeder(semanticObject, nodes);
		feeder.accept(grammarAccess.getSimpleAccess().getIDSimpleKeyword_0(), semanticObject.getID());
		feeder.finish();
	}
}
